package com.demo.grammar.java15;

public sealed interface Service permits Service.Car, Service.Truck {

    int getMaxServiceIntervalInMonths();

    default int getMaxDistanceBetweenServicesInKilometers() {
        return 100000;
    }

    final class Car implements Service {
        @Override
        public int getMaxServiceIntervalInMonths() {
            return 0;
        }
    }

    final class Truck implements Service {
        @Override
        public int getMaxServiceIntervalInMonths() {
            return 0;
        }
    }
}